package com.os.util;

import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSON;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.os.model.MetaDataInfo;
import com.os.result.Resp;

/**
 * @author 风亦未止
 * @date 2023/5/4 11:08
 */
public class ConvertMetaDataInfo {

    public  static MetaDataInfo convert(Resp resp){
        Object data = resp.getData();
        if(data == null) return null;
        JSONObject jsonObject = JSONUtil.parseObj(data);
        MetaDataInfo metaDataInfo = JSONUtil.toBean(jsonObject, MetaDataInfo.class);
        return metaDataInfo;
    }
}
